package com.bigdata.schaduler.tasks;

import cn.hutool.json.JSONUtil;
import org.apache.dolphinscheduler.plugin.task.api.AbstractTask;
import org.apache.dolphinscheduler.plugin.task.api.TaskChannel;
import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext;
import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters;
import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode;
import org.apache.dolphinscheduler.plugin.task.api.parameters.resource.ResourceParametersHelper;

public class UdtTaskChannel implements TaskChannel {
  @Override
  public void cancelApplication(boolean b) {

  }

  @Override
  public AbstractTask createTask(TaskExecutionContext taskExecutionContext) {
    return new UdtTask(taskExecutionContext);
  }

  @Override
  public AbstractParameters parseParameters(ParametersNode parametersNode) {
    return JSONUtil.toBean(parametersNode.getTaskParams(), UdtTaskParameters.class);
  }

  @Override
  public ResourceParametersHelper getResources(String s) {
    return null;
  }
}
